home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18362 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: service-2.agate.net!usenet
  2. From: ettienne@agate.net (Steve Nutt)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: THE STRUCT of C++
  5. Date: Sat, 20 Apr 1996 05:07:12 GMT
  6. Organization: DET
  7. Message-ID: <4l9k0m$mbo@service-2.agate.net>
  8. References: <Pine.SUN.3.90.960410214925.10294B-100000@rose.cs.odu.edu>
  9. Reply-To: ettienne@agate.net
  10. NNTP-Posting-Host: ettienne.sdi.agate.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. "CLEVELAND O. BURNETT" <cob@cs.odu.edu> wrote:
  14.  
  15.  
  16.  
  17. >To all who may read this?
  18.  
  19.  
  20.  
  21. >I have a textfile that I am trying to read as a C++  struct!!!!!
  22.  
  23. >How can I do this?
  24.  
  25.  
  26. >The STRUCT of C++
  27.  
  28.  
  29.  
  30. >struct students {
  31. >char firstname[20];
  32. >char middle_initial;
  33. >char lastname[20];
  34. >char address1[40];
  35. >char address2[30];
  36. >char phone_number[7];
  37. >char email[50];};
  38.  
  39.  
  40. >PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  41.  
  42.  
  43. >            Cleveland.................
  44.  
  45. You could write a << operator for it and stream the text file into the
  46. struct. If you are using Borland you may be able to use some of their
  47. base streaming classes. If not you compiler vendor may provide some.
  48.  
  49. I must confess to having not done much with streaming, but even
  50. without the base classes it does not look like a hard problem.
  51.  
  52. Steve
  53.  
  54.